package com.world.cat.controller.back;

import com.world.cat.service.sys.AppService;
import com.world.common.pojo.Result;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * Created by gang on 2017/6/8.
 */
@Controller
@RequestMapping(value = "/back/demo", name = "功能演示")
public class DemoController {
    @Resource
    private AppService appService;

    @RequestMapping(value = "/chart", name = "图表")
    public String chartLine(Model model, String id) {
        return "back/demo/chart";
    }

    @RequestMapping(value = "/abc", name = "")
    public String pictures(Model model, String id) {
        return "back/demo/pics";
    }

    @RequestMapping(value = "/chartData")
    @ResponseBody
    public Object chartData() {
        Map<String, List<String>> map = appService.statisticTable();
        return new Result(true, "", map);
    }

    @RequestMapping(value = "/iframe")
    public String iframe(Model model, String id) {
        return "back/demo/iframe";
    }

    @RequestMapping(value = "/webuploader")
    public String webuploader(Model model, String id) {
        return "back/demo/webuploader";
    }

    @RequestMapping(value = "/ueditor")
    public String ueditor(Model model, String id) {
        return "back/demo/ueditor";
    }
}
